package com.xinlan.imageeditlibrary;

import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentPagerAdapter;

import java.util.ArrayList;

/**
 * @author: 关忆北、
 * @date: 2022/4/15
 * @Des：
 */
public class EditImagePagerAdapter extends FragmentPagerAdapter {
    ArrayList<EditImageFragment> list = new ArrayList<>();

    public void setList(ArrayList<EditImageFragment> list) {
        this.list = list;
        notifyDataSetChanged();
    }

    public EditImagePagerAdapter(@NonNull FragmentManager fm) {
        super(fm);
    }

    @NonNull
    @Override
    public Fragment getItem(int position) {
        return list.get(position);
    }

    @Override
    public int getCount() {
        return list.size();
    }
}
